import { EditorInput } from '../../editor/common/input/editorInput';
import { EditorRegistry, EditorDescriptor } from '../../editor/editorRegistry';
import { FileInputRegistry } from '../../editor/inputRegistry';
import { FileModelRegistry } from '../../editor/modelRegistry';
import { SyncDescriptor } from '../../platform/instantiation/common/descriptors';
import { CodeFileEditorModel } from '../exml-exts/exml/browser/codeeditor/codeFileEditorModel';
import { CodeFileEditorInput } from '../exml-exts/exml/browser/codeeditor/codeInput';
import { CodeFileEditor } from './codeFileEditor';


/**
 * 初始化编辑器扩展
 */
export function initCodeEditorExts() {
	FileInputRegistry.registerFileInput(['.json'], CodeFileEditorInput);
	EditorRegistry.registerEditor(
		new EditorDescriptor(CodeFileEditor, CodeFileEditor.ID, '代码编辑器'),
		[new SyncDescriptor<EditorInput>(CodeFileEditorInput)]
	);
	FileModelRegistry.registerFileModel(CodeFileEditorModel, [new SyncDescriptor<EditorInput>(CodeFileEditorInput)]);
}